define(function(require) {
	var $ = require("jquery");
	var justep = require("$UI/system/lib/justep");

	var Model = function() {
		this.callParent();
	};

	
	Model.prototype.backClick = function(event){
		this.comp("windowReceiver1").windowEnsure();
		this.getParentModel().goBackCommunity();
	};

	Model.prototype.regulationDataCustomRefresh = function(event){
	    var id = JSON.parse(localStorage.getItem("userInfo")).data[2].id;
		var url = "http://www.xjzlhy.com:81/ex_community/a/api/community/getNewsByCategoryId?callback=?&category.id=4444";
		$.getJSON(
				url,
				 {
				  "office.id":id
				},
				function(data){
				    console.log("data",data);
					event.source.loadData(data.data);
					console.log("row",event.source.getFirstRow());
				}
		);
		

	};

	Model.prototype.regulationClick = function(event){
		 var row = event.bindingContext.$object;
		
		var option = {
				type:"regulation",
				title:row.val("title"),
				content:row.val("content")
		};
		
		justep.Shell.showPage("$UI/communityOto/community/channel/template.w",option);
		

	};
	
	
	
	Model.prototype.onTouchStart = function(event){
	
	     $(event.currentTarget).addClass("touch");

	};
	
	
	
	Model.prototype.onTouchEnd = function(event){
		$(event.currentTarget).removeClass("touch");
	};

	return Model;
});